package com.suke.czx.modules.express.entity;

import cn.hutool.core.date.DatePattern;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.suke.czx.common.validate.ContactSaveGroup;
import com.suke.czx.common.validate.ContactUpdateGroup;
import com.suke.czx.common.validate.ExpressUpdateGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * 应用模块名称: 快递
 * 代码描述: 快递实体
 * copyright: AUZAR ALL RIGHTS RESERVED
 * company: AUZAR
 *
 * @author: 颜米晨
 * @date: 2021/09/01 16:50:22
 */
@Data
@ApiModel(value = "快递管理")
@EqualsAndHashCode(callSuper = true)
public class Express extends Model<Express> {

    @ApiModelProperty(value = "快递id")
    @TableId(value = "express_id", type = IdType.AUTO)
    @NotNull(groups = {ExpressUpdateGroup.class}, message = "快递编码不能为空")
    public Long expressId;

    @ApiModelProperty(value = "发件人")
    @NotBlank(groups = {ContactSaveGroup.class, ContactUpdateGroup.class}, message = "发件人不能为空")
    public String sender;

    @ApiModelProperty(value = "发件人联系方式")
    public String senderContactWay;

    @ApiModelProperty(value = "收件人")
    @NotBlank(groups = {ContactSaveGroup.class, ContactUpdateGroup.class}, message = "收件人不能为空")
    public String receiver;

    @ApiModelProperty(value = "收件人联系方式")
    public String receiverContactWay;

    @ApiModelProperty(value = "签收人")
    public String signer;

    @ApiModelProperty(value = "发件日期")
    @DateTimeFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
    public Date sendDate;

    @ApiModelProperty(value = "签收日期")
    @DateTimeFormat(pattern = DatePattern.NORM_DATETIME_PATTERN)
    public Date receiveDate;

    @ApiModelProperty(value = "收件地址")
    public String receiverAddress;

    @ApiModelProperty(value = "快递公司")
    @NotBlank(groups = {ContactSaveGroup.class, ContactUpdateGroup.class}, message = "快递公司不能为空")
    public String expressCompany;

    @ApiModelProperty(value = "快递单号")
    @NotBlank(groups = {ContactSaveGroup.class, ContactUpdateGroup.class}, message = "快递单号不能为空")
    public String trackingNumber;

    @ApiModelProperty(value = "快递内容")
    public String trackingContent;

    @ApiModelProperty(value = "附件id")
    public String fileIds;

    @ApiModelProperty(value = "备注")
    public String note;

    @ApiModelProperty(value = "删除标记 0：删除 1：正常")
    public Integer del;

    @ApiModelProperty(value = "创建者id")
    public Long creator;

    @ApiModelProperty(value = "创建时间")
    public Date createTime;

    @ApiModelProperty(value = "更新者id")
    public Long updater;

    @ApiModelProperty(value = "更新时间")
    public Date updateTime;

}
